package com.capgemini.scaffold.controller;

import com.capgemini.scaffold.common.ResponseBean;
import com.capgemini.scaffold.dto.HomePage;
import com.capgemini.scaffold.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api("字典管理")
@RestController
@RequestMapping("/dict")
public class DictController {
    @Autowired
    private DictService dictService;

    /*@GetMapping
    public List<Dict> getAll(){
        return dictService.list();
    }
*//*
    @ApiOperation("查询学员状态")
    @GetMapping("/selectState")
    public ResponseBean getDict(@RequestParam("dictType") String dictType) {
        return ResponseBean.success(dictService.getDict(dictType));

    }*/
    @ApiOperation("查询字典")
    @GetMapping("/selectDict")
    public ResponseBean getDict(@RequestParam("dictTypeList") List<String> dictTypeList) {
        return ResponseBean.success(dictService.getDict(dictTypeList));
    }

    @GetMapping("/job")
    public ResponseBean<List<HomePage>> queryInternJob(){

        return ResponseBean.success(dictService.queryJobCount());
    }


    @GetMapping("/homePage")
    public ResponseBean<HomePage> querySexCount(){
        return ResponseBean.success(dictService.querySexCount());
    }
}

